/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aula_threads;

import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author G0006185
 */
public class Contador extends Thread{
    private int lim;
    private String nome;
    
    public Contador(int lim, String nome) {
        this.lim = lim;
        this.nome = nome;
    }
    public void run(){
         try {
            System.out.println("Inicio:"+nome);
            for (int i = 0; i <= lim; i++) 
                System.out.println(i+"-"+nome);
            System.out.println("Fim:"+nome);
            sleep(100);
        } catch (InterruptedException ex) {
            Logger.getLogger(Contador.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
